//
//  ViewController.m
//  Color Changer
//
//  Created by iD Student on 7/8/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController


- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    colorLabel.text = @"Welcome to my app!";

}


-(IBAction)changeBackroundColor:(id)sender
{
    
    UIButton *buttonPressed = (UIButton*)sender;
    
    if(buttonPressed == redButton)
    {
        [self.view setBackgroundColor: [UIColor redColor]];
        colorLabel.text = @"The color is red";
    }
    else if(buttonPressed == orangeButton)
    {
        [self.view setBackgroundColor: [UIColor orangeColor]];
        colorLabel.text = @"The color is orange";
    }
    else if(buttonPressed == brownButton)
    {
        [self.view setBackgroundColor: [UIColor brownColor]];
        colorLabel.text = @"The color is brown";
    }
    else if(buttonPressed == purpleButton)
    {
        [self.view setBackgroundColor: [UIColor purpleColor]];
        colorLabel.text = @"The color is purple";
    }
    else if(buttonPressed == blackButton)
    {
        [self.view setBackgroundColor: [UIColor blackColor]];
        colorLabel.text = @"The color is black";
    }
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
